import request from '@/utils/request'

const api_name = '/hr/service/job'

export default {
  get_job_page(current, limit, jobQuery) {
    return request({
      url: `${api_name}/jobs/${current}/${limit}`,
      method: 'post',
      data: jobQuery
    })
  },
  get_job(id) {
    return request({
      url: `${api_name}/job`,
      method: 'get',
      params: { id }
    })
  },
  get_jobs() {
    return request({
      url: `${api_name}/jobs`,
      method: 'get'
    })
  },
  add_job(job) {
    return request({
      url: `${api_name}/job`,
      method: 'post',
      data: job
    })
  },
  update_job(job) {
    return request({
      url: `${api_name}/job`,
      method: 'put',
      data: job
    })
  },
  delete_job(id) {
    return request({
      url: `${api_name}/job/${id}`,
      method: 'delete'
    })
  },
  publish_job(id, status) {
    return request({
      url: `${api_name}/publish/${id}/${status}`,
      method: 'put'
    })
  }
}
